Resource management systems such as database systems or database management systems are very pervasive in present day enterprises. Database systems manage data that defines the state of a database. Typically, these systems provide centralized access to information by scores of users separately as well as simultaneously. Further complicating matters is the fact that such users may be geographically dispersed, for instance across a country or continent. By way of example, in the travel industry, airline reservation systems and hotel management systems receive a multitude of requests pertaining to ticket purchases or room reservations. These systems must store large amounts of information regarding seat or room assignments, current reservations, rates and the like, as well as make this information available on demand to millions of people around the world. In another example, financial institutions such as banks use database systems to maintain account and balance information for all its customers. Additionally, the systems must respond expeditiously to requests for such information from tellers, automated teller machines (ATMs), other banks, and from customer computers.
Database systems do not solely provide query or read-only functionality. They must also support a number of fundamental transactions that can alter the state or content of a database. In particular, data can be inserted, selected, updated, modified, or deleted. This can be challenging when a plurality of users are attempting to interact with the system simultaneously. For example, a number of people may try to reserve seats on an airline at the same time. A conflict between users can cause the database to include erroneous information such as incorrect seat assignments and over-booking a flight, among other things. Proper execution of transactions preserves database integrity or correctness. Conventionally, this is referred to as concurrency control or the correctness criterion for transactions.
Concurrency control systems and methods ensure a property called serializability is maintained. More specifically concurrency control ensures that execution of a set of transactions is equivalent to the serial execution of those transactions. Thus, some transactions can execute in parallel or concurrently thereby vastly improving performance as long as the end effect is as if the transactions had executed serially one after the other.
Transaction locks can be utilized to provide concurrency control. More specifically, transactions are units of work comprising one or more partially-ordered operations (e.g., read, write . . . ). All transaction operations must successfully complete before a transaction can issue a commit request that causes data in a database to become permanently altered. Alternatively, the transaction must be aborted and any changes made rolled back or removed. Locks are used by transactions to control access to data. A transaction can lock data or a segment of memory while it is interacting with the data. The lock prevents another transaction from locking that data, thereby also preventing the other transaction from reading or altering the value of the data while the transaction that holds the lock is using the same data. When a transaction desires to interact with data, it can request a lock, from a server for instance. That request can be granted, delayed, or denied. If it is granted, then the transaction acquires the lock and can begin operating on the data. If it is delayed, the transaction simply waits for a response. If it is denied, the transaction will typically abort.
Timestamps can also be employed to provide control over the currency of data that is read. While locking deals with concurrency control at execution time, timestamps can be employed to order transactions in advance. Timestamps are unique fixed numbers representing time. Prior to execution, each transaction can be assigned or associated with a unique timestamp. The timestamps can then determine the serial order of execution. Accordingly, if a transaction Ti is assigned a timestamp TSi that is less than timestamp TSj associated with transaction Tj, then the system must ensure that execution schedule is equivalent to a serial schedule where Ti is executed prior to Tj. To implement this, timestamps can be associated with data items, such as a write time stamp denoting the largest timestamp of a transaction that wrote successfully to the data item and a read timestamp denoting the largest value of a transaction that executed a read on that data item successfully. A timestamp ordering protocol can then be employed to ensure serializability.
Another fundamental property of transactions is durability. Once a transaction commits, meaning it completes successfully, then changes to the storage state should be preserved such that they can survive failure (e.g., power failure, system crash . . . ). Database systems provide for durable data storage, for example on disk. However, it is expensive in terms of the time required to interact with database data stored on disk. Accordingly, a cache (e.g., server, cache) is used to store data copies that are accessed more frequently. Utilization of a cache reduces the number of times the database storage medium needs to be accessed and therefore can dramatically improve the speed that data is made available. For example, a news organization's web server may cache the home page and all popular articles to ensure expeditious retrieval. However, a system must ensure that the cache is consistent with the database as it can be altered by user transactions. Thus, the database system must monitor the cache and upon change trigger an update transaction to effect changes on the database. Additionally, the database system can then refresh other cached copies maintained.